{% extends "base.html" %}
{% load static %}

{% block headjs %}
    <link href="{% static 'datatables/datatables.min.css' %}" rel="stylesheet">

{% endblock %}

{% block content %}
    <div class="row">
        <div class="col-lg">
            <div class="card">
                <div class="card-header">

  <div class="row">
    <div class="col-sm">
      <a type="button" class="btn btn-success" href="{% url 'Kehu_Create' %}">新增客户</a>
        <a type="button" class="btn btn-success" href="{% url 'Kehu_Create' %}">导入</a>
        <a type="button" class="btn btn-success" href="{% url 'Kehu_Create' %}">导出</a>
    </div>
    <div class="col-sm">
      <form class="form-inline my-2 my-lg-0 ml-auto" method="get" action="">
                        <input class="form-control mr-sm-2" type="search" placeholder="模糊搜索" aria-label="Search" name="search">
                        <button class="btn btn-outline-success my-2 my-sm-0" type="submit">搜索</button>
                    </form>
    </div>
    <div class="col-sm">
      One of three columns
    </div>
  </div>


                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table  id="example2" class="table table-striped table-bordered dt-container dt-bootstrap4" >
                            <thead>
                            <tr>
                                <th>产品名称</th>
                                <th>售价</th>
                                <th>底价</th>
                                <th>类别</th>
                                <th>供应商</th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for chanpin in chanpins %}
                                <tr>
                                    <th>{{ chanpin.title }}</th>
                                    <th> {{ chanpin.jiage }} </th>
                                    <th> {{ chanpin.jiage_dijia }} </th>
                                    <th> {{ chanpin.leibie }} </th>
                                    <th> {{ chanpin.gys }} </th>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>

                    </div>
                </div>
            </div>

        </div>
    </div>
{% endblock %}

{% block footerjs %}

    <script src="https://cdn.datatables.net/2.1.8/js/dataTables.bootstrap4.js"></script>
        <script src="{% static 'datatables/datatables.min.js' %}"></script>

{% endblock %}
